//
//  YWBaseCell.m
//  maintain
//
//  Created by 烟雨云渊 on 2017/5/23.
//  Copyright © 2017年 ewin. All rights reserved.
//

#import "YWBaseCell.h"
#import "UIColor+CustomColors.h"

@implementation YWBaseCell

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    YWBaseCell *cell = [tableView dequeueReusableCellWithIdentifier:YWBaseCellIdentifier];
    if (cell == nil) {
        cell = [[YWBaseCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:YWBaseCellIdentifier];
    }
    return cell;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.layer.shouldRasterize = YES;
        self.layer.rasterizationScale = [UIScreen mainScreen].scale;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.clipsToBounds = YES;
    }
    return self;
}

- (UIView*)separatorLineView{
    if (!_separatorLineView) {
        UIView *view = [[UIView alloc] init];
        view.backgroundColor = [UIColor customBackgroudColor];
        _separatorLineView = view;
        [self.contentView addSubview:_separatorLineView];
    }
    return _separatorLineView;
}

- (YYLabel*)observersLabel{
    if (!_observersLabel) {
        YYLabel *label = [[YYLabel alloc] init];
        label.numberOfLines = 0;
        _observersLabel = label;
        [self.contentView addSubview:_observersLabel];
    }
    return _observersLabel;
}

- (YYLabel*)replyLabel{
    if (!_replyLabel) {
        YYLabel *label = [[YYLabel alloc] init];
        label.numberOfLines = 0;
        _replyLabel = label;
        [self.contentView addSubview:_replyLabel];
    }
    return _replyLabel;
}

- (YYLabel*)materialsLabel{
    if (!_materialsLabel) {
        YYLabel *label = [[YYLabel alloc] init];
        label.numberOfLines = 0;
        _materialsLabel = label;
        [self.contentView addSubview:_materialsLabel];
    }
    return _materialsLabel;
}
@end
